package com.weipai.springboot.module.dao.impl;

import com.weipai.springboot.model.Brand;
import com.weipai.springboot.model.Shop;
import com.weipai.springboot.model.ShopCategory;
import com.weipai.springboot.module.dao.ShopCategoryDao;
import com.weipai.springboot.module.mapper.ShopCategoryMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import sun.nio.cs.ext.SJIS;

import java.util.List;

/**
 * @Author: 曹朋飞
 * @Date: 2018/08/27 14:29
 */
@Repository
public class ShopCategoryDaoImpl implements ShopCategoryDao{

    @Autowired
    ShopCategoryMapper shopCategoryMapper;
    
    //保存
    @Override
    public int insert(ShopCategory shopCategory) {
        return shopCategoryMapper.insert(shopCategory);
    }

    //修改
    @Override
    public int updateByPrimaryKey(ShopCategory shopCategory) {
        return shopCategoryMapper.updateByPrimaryKey(shopCategory);
    }

    //查询店铺类别详情
    @Override
    public ShopCategory getShopCategoryById(String shopCategoryId) {
        return shopCategoryMapper.getShopCategoryById(shopCategoryId);
    }

    //获取数据（不包含逻辑删除的数据）
    @Override
    public List<Shop> selectAllByShopCategoryDel(int shopCategoryDel, String search, String sort, String way) {
        return shopCategoryMapper.selectAllByShopCategoryDel(shopCategoryDel, search, sort,way);
    }

    //更改商品类别的状态
    @Override
    public int updateStatus(String shopCategoryId, Integer status) {
        return shopCategoryMapper.updateStatus(shopCategoryId, status);
    }

    //批量删除
    @Override
    public int batchDeleteById(String[] id) {
        return shopCategoryMapper.batchDeleteById(id);
    }
}
